package MyGame;

import DEMOS.LayerOne;
import edu.chalmers.AV_2DPlatformerFramework.Model.*;
import edu.chalmers.AV_2DPlatformerFramework.Utility.*;
import edu.chalmers.Framework_EXAMPLES.EXAMPLE_Bench;

/**
 *
 * @author Joakim Karlsson
 */
public class Object_Bench extends GameObject {
    
    public Object_Bench() throws Hitbox.HitboxMalformedException {
        super(null);
        Vector2D[] vertices = {new Vector2D(0, 0), new Vector2D(142, 0),
        new Vector2D(142, 50), new Vector2D(0, 50)};
        setHitbox(new Hitbox(vertices));
        this.setStrata(1000000);
        String s = System.getProperty("file.separator");
        addTexture(new Texture("."+s+"src"+s+"main"+s+"java"+s+"Textures"
                            +s+"bench.gif", this.getHitbox().getBounds2D()));
    }
    
    public Object_Bench(Vector2D velocity) throws Hitbox.HitboxMalformedException {
        super(null);
        Vector2D[] vertices = {new Vector2D(0, 0), new Vector2D(142, 0),
                new Vector2D(142, 50), new Vector2D(0, 50)};
        setHitbox(new Hitbox(vertices));
        String s = System.getProperty("file.separator");
        addTexture(new Texture("."+s+"src"+s+"main"+s+"java"+s+"Textures"
                            +s+"bench.gif", this.getHitbox().getBounds2D()));
        setVelocity(velocity);
    }
    
    @Override
    public void onCollision(GameObject otherObject) {
        //TODO 
    }
    
    @Override
    public void setVelocity(Vector2D v){
    }

    @Override
    public GameObject copy() {
        try {
           EXAMPLE_Bench copy = new EXAMPLE_Bench(this.getVelocity());
           this.copyVariablesTo(copy);
           return copy;
        } catch (Hitbox.HitboxMalformedException ex) {
            return null;
        }
    }
}